package system.admin;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.json.JSONObject;

import DB.DB_connection_pool;
import bean.Admin_inf;
import bean.Credit_parameter;

public class Admin_weight_edit extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		HttpSession session = request.getSession();
		
		int weight_Jurisdiction = (int)session.getAttribute("weight_Jurisdiction");
		
		if(weight_Jurisdiction == 1){
			
			request.setAttribute("logon_1", Credit_parameter.getLogon_1());
			request.setAttribute("logon_2", Credit_parameter.getLogon_2());
			request.setAttribute("logon_3", Credit_parameter.getLogon_3());
			request.setAttribute("logon_4", Credit_parameter.getLogon_4());
			request.setAttribute("logon_5", Credit_parameter.getLogon_5());
			request.setAttribute("logon_6", Credit_parameter.getLogon_6());
			request.setAttribute("logon_7", Credit_parameter.getLogon_7());
			request.setAttribute("praise", Credit_parameter.getPraise());
			request.setAttribute("review", Credit_parameter.getReview());
			request.setAttribute("attention", Credit_parameter.getAttention());
			request.setAttribute("forward", Credit_parameter.getForward());
			request.setAttribute("publish_dynamic", Credit_parameter.getPublish_dynamic());
			request.setAttribute("praise_log", Credit_parameter.getPraise_log());
			request.setAttribute("review_log", Credit_parameter.getReview_log());
			request.setAttribute("attention_log", Credit_parameter.getAttention_log());
			request.setAttribute("forward_log", Credit_parameter.getForward_log());
			request.setAttribute("match_level_1", Credit_parameter.getMatch_level_1());
			request.setAttribute("match_level_2", Credit_parameter.getMatch_level_2());
			request.setAttribute("match_level_3", Credit_parameter.getMatch_level_3());
			request.setAttribute("match_level_4", Credit_parameter.getMatch_level_4());
			request.setAttribute("profession_running_result_weight", Credit_parameter.getProfession_running_result_weight());
			request.setAttribute("profession_running_record_weight", Credit_parameter.getProfession_running_record_weight());
			request.setAttribute("profession_basketball_steal_weight", Credit_parameter.getProfession_basketball_steal_weight());
			request.setAttribute("profession_basketball_assist_weight", Credit_parameter.getProfession_basketball_assist_weight());
			request.setAttribute("profession_basketball_rebound_weight", Credit_parameter.getProfession_basketball_rebound_weight());
			request.setAttribute("profession_basketball_ponit_weight", Credit_parameter.getProfession_basketball_ponit_weight());
			request.setAttribute("profession_basketball_result_weight", Credit_parameter.getProfession_basketball_result_weight());
			request.setAttribute("profession_basketball_record_weight", Credit_parameter.getProfession_basketball_record_weight());
			request.setAttribute("profession_swimming_result_weight", Credit_parameter.getProfession_swimming_result_weight());
			request.setAttribute("profession_swimming_record_weight", Credit_parameter.getProfession_swimming_record_weight());
			request.setAttribute("dynamic_equilibrium", Credit_parameter.getDynamic_equilibrium());
			
				request.getRequestDispatcher("/admin_weight_edit.jsp").forward(request, response);
		}else{
			//没有权限
			response.sendRedirect("/error-500.jsp");
		}
		
	}

}
